
<?php

class reportUnicefCLS extends Module
{
	var $connDB = 1;
	var $func;
	var $funcDB = false;
	var $sqlFunc = 1;
	var $request = array();
	var $usrInfo = array();
	var $appLog = 1;

	var $table = array();
	var $type = "";
	var $totRow;
	var $analyzeArray = 1;

	function reportUnicef_0100()
	{
		//0100 - VARIAZIONE ANAGRAFICA
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);
// 		$dataCarta = split("/",$arr['ccScadenzaCarta']);
// 		print_r($dataTracciatoARR);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0100-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
			SELECT '0100'AS tipoRecord, t5.codice,
			CASE WHEN t5.cognome='null' THEN '' ELSE t5.cognome END AS cognome,
			CASE WHEN t5.nome='null' THEN '' ELSE t5.nome END AS nome,
			CASE WHEN t5.ragioneSociale='null' THEN '' ELSE t5.ragioneSociale END AS ragioneSociale,
			CASE WHEN t5.sesso='null' THEN '' ELSE t5.sesso END AS sesso,
			CASE WHEN t5.dug='null' THEN '' ELSE t5.dug END AS dug,
			CASE WHEN t5.indirizzo='null' THEN '' ELSE t5.indirizzo END AS indirizzo,
			CASE WHEN t5.civico1='null' THEN '' ELSE t5.civico1 END AS civico1,
			CASE WHEN t5.civico2='null' THEN '' ELSE t5.civico2 END AS civico2,
			CASE WHEN t5.frazione='null' THEN '' ELSE t5.frazione END AS frazione,
			CASE WHEN t5.localita='null' THEN '' ELSE t5.localita END AS localita,
			CASE WHEN t5.cap='null' THEN '' ELSE t5.cap END AS cap,
			CASE WHEN t5.provincia='null' THEN '' ELSE t5.provincia END AS provincia,
			CASE WHEN t5.contatto='null' THEN '' ELSE t5.contatto END AS contatto,
			CASE WHEN t5.tipoAnagrafica='null' THEN '' ELSE t5.tipoAnagrafica END AS tipoAnagrafica,
			CASE WHEN t5.partitaIva='null' THEN '' ELSE t5.partitaIva END AS partitaIva,
			CASE WHEN t5.codiceFiscale='null' THEN '' ELSE t5.codiceFiscale END AS codiceFiscale,
			CASE WHEN t5.professione IS NULL THEN '' ELSE t5.professione END AS professione,
			CASE WHEN t5.presso='null' THEN '' ELSE t5.presso END AS presso,
			CASE WHEN t5.dataDiNascita='0000-00-00' THEN '' ELSE t5.dataDiNascita END AS dataDiNascita
			FROM contaqChiamate t2 
			INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
			INNER JOIN contaqRaccoltaDatiAnagraficaUnicef t5 ON t5.codice=t3.codice
			INNER JOIN contaqAnagraficaUnicef t6 ON t5.codice=t6.codice 
			WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport 
			AND t5.tipoRecord='0100'
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0100: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0120()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0120-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT tipoRecord,z1.codice,z2.esito,fonte,tipoContatto,vecchio,nuovo,
				CASE WHEN nuovo NOT LIKE '%@%' THEN '' ELSE consensoEmail END consensoEmail FROM 
				(SELECT DISTINCT t1.idLista,t1.codice FROM contaqListe t1 INNER JOIN contaqChiamate t2
				ON t1.idLista=t2.idLista AND t2.stato=1 AND  DATE_FORMAT(t2.dataFineChiamata,'%Y-%m-%d')=$dataReport )AS z1
				 INNER JOIN contaqRaccoltaDatiContattiUnicef  z2 ON z1.codice=z2.codice
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0120: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0190()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0190-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '0190'AS tipoRecord, t5.codice,
				CASE WHEN t5.cognome='null' THEN '' ELSE t5.cognome END AS cognome,
				CASE WHEN t5.nome='null' THEN '' ELSE t5.nome END AS nome,
				CASE WHEN t5.ragioneSociale='null' THEN '' ELSE t5.ragioneSociale END AS ragioneSociale,
				CASE WHEN t5.sesso='null' THEN ''ELSE t5.sesso END AS sesso,
				CASE WHEN t5.dug='null' THEN '' ELSE t5.dug END AS dug,
				CASE WHEN t5.indirizzo='null' THEN '' ELSE t5.indirizzo END AS indirizzo,
				CASE WHEN t5.civico1='null' THEN '' ELSE t5.civico1 END AS civico1,
				CASE WHEN t5.civico2='null' THEN '' ELSE t5.civico2 END AS civico2,
				CASE WHEN t5.frazione='null' THEN '' ELSE t5.frazione END AS frazione,
				CASE WHEN t5.localita='null' THEN '' ELSE t5.localita END AS localita,
				CASE WHEN t5.cap='null' THEN ''ELSE t5.cap END AS cap,
				CASE WHEN t5.provincia='null' THEN '' ELSE t5.provincia END AS provincia,
				CASE WHEN t5.contatto='null' THEN '' ELSE t5.contatto END AS contatto,
				CASE WHEN t5.tipotel1 IS NULL THEN '' ELSE t5.tipotel1 END AS tipotel1,
				CASE WHEN t5.telefono1 IS NULL THEN '' ELSE t5.telefono1 END AS telefono1,
				CASE WHEN t5.tipotel2 IS NULL THEN '' ELSE t5.tipotel2 END AS tipotel2,
				CASE WHEN t5.telefono2 IS NULL THEN '' ELSE t5.telefono2 END AS telefono2,
				CASE WHEN t5.tipotel3 IS NULL THEN '' ELSE t5.tipotel3 END AS tipotel3,
				CASE WHEN t5.telefono3 IS NULL THEN '' ELSE t5.telefono3 END AS telefono3,
				CASE WHEN t5.tipotel4 IS NULL THEN '' ELSE t5.tipotel4 END AS tipotel4,
				CASE WHEN t5.telefono4 IS NULL THEN '' ELSE t5.telefono4 END AS telefono4,
				CASE WHEN t5.tipotel5 IS NULL THEN '' ELSE t5.tipotel5 END AS tipotel5,
				CASE WHEN t5.telefono5 IS NULL THEN '' ELSE t5.telefono5 END AS telefono5,
				t5.fax,t5.email,
				CASE WHEN t5.tipoAnagrafica='null' THEN '' ELSE t5.tipoAnagrafica END AS tipoAnagrafica,
				CASE WHEN t5.partitaIva='null' THEN '' ELSE t5.partitaIva END AS partitaIva,
				CASE WHEN t5.codiceFiscale='null' THEN '' ELSE t5.codiceFiscale END AS codiceFiscale,
				CASE WHEN t5.professione IS NULL THEN '' ELSE t5.professione END AS professione,
				CASE WHEN t5.dataDiNascita='0000-00-00' THEN '' ELSE t5.dataDiNascita END AS dataDiNascita,
				CASE WHEN t5.email LIKE '%@%' THEN 'SI' ELSE '' END AS flagConsensoEmail
				FROM contaqChiamate t2 
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqRaccoltaDatiAnagraficaUnicef t5 ON t5.codice=t3.codice
				INNER JOIN contaqAnagraficaUnicef t6 ON t5.codice=t6.codice 
				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport 
				AND t5.tipoRecord='0190'
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0190: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}


	function reportUnicef_0220()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0220-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '0220'AS tipoRecord, t3.codice,DATE_FORMAT(dataFineChiamata,'%Y/%m/%d')DATA
				FROM  contaqChiamateUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice

				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport 
				AND t1.esito101=1
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0220: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0220_old()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0220-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '0220'AS tipoRecord, t3.codice,DATE_FORMAT(dataFineChiamata,'%Y/%m/%d')DATA
				FROM  contaqRaccoltaAltriDatiUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice

				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport AND
				t1.esito  IN (101)
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0220_old: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0230()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0230-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '0230'AS tipoRecord, t3.codice
				FROM  contaqChiamateUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice

				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport AND
				t1.esito102=1
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0230: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0230_old()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0230-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM
			(
				SELECT '0230'AS tipoRecord, t3.codice
				FROM  contaqRaccoltaAltriDatiUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice

				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport AND
				t1.esito  IN (102)
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0230_old: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0510()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0510-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT t1.tipoRecord,t1.codice,numeroCarta,scadenza,
				t4.codice AS codice2,cognomeTitolare,importo, '000' AS codice3, t5.data, '' AS operazione, '' AS note
				FROM contaqRaccoltaDatiUpgradePledgeUnicef t1
				INNER JOIN contaqListe t2 ON t1.codice=t2.codice
				INNER JOIN contaqChiamate t3 ON t2.idLista=t3.idLista AND t3.stato=1
				AND  DATE_FORMAT(t3.dataFineChiamata,'%Y-%m-%d')=$dataReport 
				LEFT JOIN contaqCircuitiCarteDiCreditoUnicef t4 ON t4.codice=t1.circuito
				INNER JOIN contaqRaccoltaAltriDatiUnicef t5 ON t5.chiamataId=t3.chiamataId AND t3.stato=1
				WHERE t1.tipoRecord = 0510
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0510: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0670()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0670-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT 
				tipoRecord,t1.codice,numeroAdesione,tipoAzione,
				importo,mezzoPagamento,periodicita,''iban,''a,''b,''c,''d,''e,''f, '' as note
				FROM contaqRaccoltaDatiUpgradePledgeUnicef t1
				INNER JOIN contaqListe t2 ON t1.codice=t2.codice
				INNER JOIN contaqChiamate t3 ON t2.idLista=t3.idLista AND t3.stato=1
				AND  DATE_FORMAT(t3.dataFineChiamata,'%Y-%m-%d')=$dataReport
				LEFT JOIN contaqCircuitiCarteDiCreditoUnicef t4 ON t4.descrizione=t1.circuito
				WHERE tipoRecord = 0670
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0670: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	
	function reportUnicef_0910()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0910-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '0910' AS tipoRecord,t3.codice FROM contaqRaccoltaAltriDatiUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t2.idLista=t3.idLista
				WHERE t1.esito=114 AND  DATE_FORMAT(t2.dataFineChiamata,'%Y-%m-%d')=$dataReport
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0910: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_0950()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR0950-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '0950' AS tipoRecord,t1.codice, left(t1.note1,199) ,'' as note

				FROM contaqRaccoltaDatiSostenitoreUnicef t1

				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId

				WHERE DATE_FORMAT(t2.dataFineChiamata,'%Y-%m-%d')=$dataReport
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "0950: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_2110()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR2110-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '2110' AS tiporecord,t1.codice,DATE_FORMAT(t2.dataFineChiamata,'%Y/%m/%d')AS DATA,t4.campagna,
				t4.lotto,'' AS note
				 FROM contaqListe t1 
				INNER JOIN contaqChiamate t2 ON t1.idlista=t2.idLista 
				AND t2.stato=1 AND DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')=$dataReport
				INNER JOIN contaqChiamateUnicef t3 ON t3.chiamataId=t2.chiamataId
				AND (t3.esito104=1 OR esito105=1 OR esito106=1 OR esito107=1 OR esito108=1 OR esito109=1
				OR esito110=1 OR esito115=1)


				INNER JOIN contaqAnagraficaUnicef t4 ON t1.codice=t4.codice
				UNION
				SELECT 
				'2110' AS tipoRecord,t1.codice,DATE_FORMAT(t3.dataFineChiamata,'%Y/%m/%d')AS DATA,
				t4.campagna,lotto, ''AS note
				FROM contaqRaccoltaDatiUpgradePledgeUnicef t1
				INNER JOIN contaqListe t2 ON t1.codice=t2.codice
				INNER JOIN contaqChiamate t3 ON t2.idLista=t3.idLista AND t3.stato=1
				AND  DATE_FORMAT(t3.dataFineChiamata,'%Y-%m-%d')=$dataReport 
				INNER JOIN contaqAnagraficaUnicef t4 ON t1.codice=t4.codice
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "2110: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_2110_old()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR2110-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '2110' AS tiporecord,t1.codice,DATE_FORMAT(t2.dataFineChiamata,'%Y/%m/%d')AS DATA,t4.campagna,
				t4.lotto
				 FROM contaqListe t1 
				INNER JOIN contaqChiamate t2 ON t1.idlista=t2.idLista 
				AND t2.stato=1 AND DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')=$dataReport
				INNER JOIN contaqRaccoltaAltriDatiUnicef t3 ON t3.chiamataId=t2.chiamataId
				AND t3.esito  IN (104,105,106,107,108,109,110,115)
				INNER JOIN contaqAnagraficaUnicef t4 ON t1.codice=t4.codice
				UNION
				SELECT 
				'2110' AS tipoRecord,t1.codice,DATE_FORMAT(t3.dataFineChiamata,'%Y/%m/%d')AS DATA,
				t4.campagna,lotto
				FROM contaqRaccoltaDatiUpgradePledgeUnicef t1
				INNER JOIN contaqListe t2 ON t1.codice=t2.codice
				INNER JOIN contaqChiamate t3 ON t2.idLista=t3.idLista AND t3.stato=1
				AND  DATE_FORMAT(t3.dataFineChiamata,'%Y-%m-%d')=$dataReport 
				INNER JOIN contaqAnagraficaUnicef t4 ON t1.codice=t4.codice
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "2110_old: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_2120()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR2120-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '2120'AS tipoRecord, t3.codice,DATE_FORMAT(dataFineChiamata,'%Y/%m/%d')DATA,

				CASE WHEN t1.esito104 =1 THEN '001' WHEN t1.esito105=1 THEN '002' WHEN t1.esito106=1 THEN '003'
				WHEN t1.esito107=1 THEN '004' WHEN t1.esito108=1 THEN '005' WHEN t1.esito109=1 THEN '006'
				WHEN t1.esito110=1 THEN '007' WHEN t1.esito115=1 THEN '008' ELSE NULL END AS motivo
				FROM  contaqChiamateUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice

				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport AND
				(esito104=1 OR esito105=1 OR esito106=1 OR esito107=1 OR esito108=1 OR esito109=1
				OR esito110=1 OR esito115=1)
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "2120_old: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}



	function reportUnicef_2120_old()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR2120-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '2120'AS tipoRecord, t3.codice,DATE_FORMAT(dataFineChiamata,'%Y/%m/%d')DATA,
				CASE WHEN t1.esito=104 THEN '001' WHEN t1.esito=105 THEN '002' WHEN t1.esito=106 THEN '003'
				WHEN t1.esito=107 THEN '004' WHEN t1.esito=108 THEN '005' WHEN t1.esito=109 THEN '006'
				WHEN t1.esito=110 THEN '007' WHEN t1.esito=115 THEN '008'ELSE NULL END AS motivo
				FROM  contaqRaccoltaAltriDatiUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t3.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice

				WHERE  DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport AND
				t1.esito  IN (104,105,106,107,108,109,110,115)
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "2120: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	
	function reportUnicef_2160()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR2160-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '2160' AS tipoRecord,t3.codice,DATE_FORMAT(dataFineChiamata,'%Y/%m/%d')DATA
				FROM contaqChiamateUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t2.idLista=t3.idLista
				WHERE t1.esito103=1 AND DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "2160: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportUnicef_2160_old()
	{
		//
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
		$dataReport = $this->sqlFunc->_type_format("date", $this->request["dataReport"]);
		$dataTracciatoARR = split("/",$this->request["dataReport"]);

		$dataTracciato= substr($dataTracciatoARR[2],2,2).$dataTracciatoARR[1].$dataTracciatoARR[0];
		
		$sql = "SELECT *
			INTO OUTFILE '/home/svil/contaqWorkbench/reports2/".$this->request["cartellaTracciato"]."CQ1UA2-TR2160-$dataTracciato.txt'
			FIELDS TERMINATED BY '|'
			ENCLOSED BY ''
			ESCAPED BY ''
			LINES TERMINATED BY '\r\n'
			FROM

			(
				SELECT '2160' AS tipoRecord,t3.codice,DATE_FORMAT(dataFineChiamata,'%Y/%m/%d')DATA
				 FROM contaqRaccoltaAltriDatiUnicef t1
				INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId
				INNER JOIN contaqListe t3 ON t2.idLista=t3.idLista
				WHERE t1.esito=103 AND DATE_FORMAT(dataFineChiamata,'%Y-%m-%d') =$dataReport
			)

			 AS gof

			";
				
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->usrInfo[] = "2160_old: Error DB - ".$this->connDB->ErrorMsg();
			return;
		}

		return true;
	}

	function reportContatti()
	{
		$dataInizio = $this->sqlFunc->_type_format("date", $this->request["fDataInizio"]);
		
		$this->connDB->SetFetchMode(ADODB_FETCH_ASSOC);
	
		$sql = "SELECT z0.lotto,
				z0.data,
				s1.upgrade,
				s1.upgradeVariazionePeriodicita AS upgradeVarPer,
				s1.upgradeVariazioneModPag AS upgradeVarModPag, 
				s1.ONEOFF,
				s1.downgrade,
				s2.contattiUtiliVariazionePeriodicita AS cuVarPer, 
				s2.contattiUtiliVariazioneModPag AS cuVarModPag,
				z3.donatoreNonInteressatoNew AS nonInteressato,

				/*z2.donatoreNonInteressatoOld,*/
				/*z3.cancellazioneLeggePrivacy,z3.decesso,z3.noTlmk,z3.donatoreNonRintracciabile,z3.richiestaContatto,*/
				/*z5.donatoreNonRintracciabileOld,numeroErratoOld,decessoOld,noTlmkOld,
				cancellazioneLeggePrivacyOld,richiestaContattoOld,*/

				cancellazioneLeggePrivacyNew AS cancLegPriv,
				decessoNew AS decessi,
				noTlmkNew AS noTlmk,
				donatoreNonRintracciabileNew AS nonRintracciabile, 
				richiestaContattoNew AS ricCont,
				numeroErratoNew AS numeroErrato

				 FROM 
				(
				SELECT COUNT(*)totali,lotto,DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')DATA
				 FROM contaqChiamate t1
				INNER JOIN contaqListe t2 ON t1.idLista=t2.idLista
				INNER JOIN contaqAnagraficaUnicef t3 ON t2.codice=t3.codice
				WHERE t1.stato=1 GROUP BY lotto,DATA) 
				AS z0 LEFT OUTER JOIN 
				 
				(
				SELECT lotto,
				DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')AS DATA,
				SUM(CASE WHEN t1.importoRata<t2.importo/100 AND t2.tipoRecord<>'0510' THEN 1 ELSE 0 END)AS UPGRADE,
				SUM(CASE WHEN t1.importoRata>t2.importo/100  AND t2.tipoRecord<>'0510' THEN 1 ELSE 0 END)AS downgrade,
				SUM(CASE WHEN t2.tipoRecord='0510' THEN 1 ELSE 0 END )AS 'ONEOFF',
				/*VERIFICARE VARIAZIONI*/
				SUM(CASE WHEN periodicitaRata=periodicita AND tipoAzione='UP'  THEN 0 WHEN tipoAzione='OF' THEN 0 ELSE 1 END)AS upgradeVariazionePeriodicita,
				SUM(CASE WHEN mezzoPagamentoCod=t2.mezzoPagamento AND tipoAzione='UP' THEN 0 WHEN tipoAzione='OF' THEN 0 ELSE 1 END)AS upgradeVariazioneModPag

				FROM contaqAnagraficaDatiUnicef t1
				INNER JOIN contaqRaccoltaDatiUpgradePledgeUnicef  t2 ON t1.codice=t2.codice
				INNER JOIN contaqListe t3 ON t1.codice=t3.codice
				INNER JOIN contaqChiamate t4 ON t3.idLista=t4.idLista AND t4.stato=1
				INNER JOIN contaqAnagraficaUnicef t5 ON t5.codice=t1.codice
				/*WHERE t2.tipoRecord <>'0510' AND tipoAzione IN ('UP','DO')*/
				GROUP BY DATA,lotto
				) 
				AS s1 ON z0.lotto=s1.lotto AND z0.data=s1.data

				LEFT OUTER JOIN 
				(
				SELECT lotto,
				DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')AS DATA,
				SUM(CASE WHEN periodicitaRata=periodicita THEN 0 ELSE 1 END)AS contattiUtiliVariazionePeriodicita,
				SUM(CASE WHEN mezzoPagamentoCod=t2.mezzoPagamento  THEN 0 ELSE 1 END)AS contattiUtiliVariazioneModPag

				FROM contaqAnagraficaDatiUnicef t1
				INNER JOIN contaqRaccoltaDatiUpgradePledgeUnicef  t2 ON t1.codice=t2.codice
				INNER JOIN contaqListe t3 ON t1.codice=t3.codice
				INNER JOIN contaqChiamate t4 ON t3.idLista=t4.idLista AND t4.stato=1
				INNER JOIN contaqAnagraficaUnicef t5 ON t5.codice=t1.codice
				WHERE t2.tipoRecord <>'0510' AND tipoAzione='VA'
				GROUP BY DATA,lotto
				)
				AS s2 ON z0.data=s2.data AND z0.lotto=s2.lotto

				/*
				LEFT OUTER JOIN 
				(
				SELECT COUNT(*)donatoreNonInteressatoOld, DATE_FORMAT(contaqChiamate.dataFineChiamata,'%Y-%m-%d')AS DATA,lotto FROM 
				(SELECT chiamataId,esito
				FROM  contaqRaccoltaAltriDatiUnicef 
				WHERE 
				esito  IN (104,105,106,107,108,109,110,115)) AS z
				INNER JOIN contaqChiamate ON z.chiamataId=contaqChiamate.chiamataId AND contaqChiamate.stato=1
					INNER JOIN contaqListe t3 ON contaqChiamate.idLista=t3.idLista
					INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice
					GROUP BY DATA,lotto
					
				) AS z2 
				ON z0.data=z2.data AND z0.lotto=z2.lotto
				*/
				LEFT OUTER JOIN 
				(
				SELECT 	DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')DATA,lotto,
					SUM(esito100)cancellazioneLeggePrivacy,SUM(esito101)decesso,SUM(esito102)noTlmk,
					SUM(esito103)+SUM(CASE WHEN t2.esito IN (3) THEN 1 ELSE 0 END)AS donatoreNonRintracciabile,
					SUM(esito114)richiestaContatto, 
					SUM(esito104)+SUM(esito105)+SUM(esito106)+SUM(esito107)+SUM(esito108)+ 
					SUM(esito109)+SUM(esito110)+SUM(esito115) AS donatoreNonInteressatoNew	
					FROM 
					contaqChiamateUnicef t1 
					INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId AND t2.stato=1
					INNER JOIN contaqListe t3 ON t2.idLista=t3.idLista
					INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice
					GROUP BY DATA,lotto
					) 
				AS z3 ON z0.data=z3.data AND z0.lotto=z3.lotto
					
				/*
				LEFT OUTER JOIN 

				(
				SELECT 
				SUM(CASE WHEN z.esito IN (3,103) THEN 1 ELSE 0 END) AS donatoreNonRintracciabileOld,
				SUM(CASE WHEN z.esito IN (4,6) THEN 1 ELSE 0 END) AS numeroErratoOld,
				SUM(CASE WHEN z.esito IN (101) THEN 1 ELSE 0 END) AS decessoOld,
				SUM(CASE WHEN z.esito IN (102) THEN 1 ELSE 0 END) AS noTlmkOld,
				SUM(CASE WHEN z.esito IN (100) THEN 1 ELSE 0 END) AS cancellazioneLeggePrivacyOld,
				SUM(CASE WHEN z.esito IN (114) THEN 1 ELSE 0 END) AS richiestaContattoOld,
				 lotto,DATE_FORMAT(contaqChiamate.dataFineChiamata,'%Y-%m-%d')AS DATA FROM 

				(SELECT chiamataId,esito FROM  contaqRaccoltaAltriDatiUnicef 
				WHERE esito  IN (3,4,6,100,101,102,103,114)) AS z
				INNER JOIN contaqChiamate ON z.chiamataId=contaqChiamate.chiamataId AND contaqChiamate.stato=1
				INNER JOIN contaqListe t2 ON t2.idLista=contaqChiamate.idLista
				INNER JOIN contaqAnagraficaUnicef t3 ON t3.codice=t2.codice
				GROUP BY DATA,lotto
				) AS z5 
				ON z0.data=z5.data AND z0.lotto=z5.lotto
				*/
				LEFT OUTER JOIN 

				(
				SELECT 	DATE_FORMAT(dataFineChiamata,'%Y-%m-%d')DATA,lotto,
					SUM(esito100)cancellazioneLeggePrivacyNew,
					SUM(esito101)decessoNew,
					SUM(esito102)noTlmkNew,
					SUM(esito103)+ SUM(CASE WHEN esito IN (3) THEN 1 ELSE 0 END ) donatoreNonRintracciabileNew,
					SUM(esito114)richiestaContattoNew,
					SUM(CASE WHEN esito IN (4,6) THEN 1 ELSE 0 END) AS numeroErratoNew
					
					FROM 
					contaqChiamateUnicef t1 
					INNER JOIN contaqChiamate t2 ON t1.chiamataId=t2.chiamataId AND t2.stato=1
					INNER JOIN contaqListe t3 ON t2.idLista=t3.idLista
					INNER JOIN contaqAnagraficaUnicef t4 ON t3.codice=t4.codice
					GROUP BY DATA,lotto
					)
				AS z6 ON z0.data=z6.data AND z0.lotto=z6.lotto

				WHERE CONVERT(z0.data,DATE)=$dataInizio
				ORDER BY DATA";
			
// 		$sql .= " ORDER BY ".$this->request['order']." ".$this->request['orderType'];
		
// 		print $sql;
		
		$rs = $this->connDB->Execute( $sql );
		
		$this->appLog->logWrite($sql);
		if ( $rs === false )
		{			
			$this->appLog->logWrite($this->connDB->ErrorMsg());
			$this->sysError[] = "Error DB : ".$this->connDB->ErrorMsg();
			print_r ($this->sysError);
			return;
		}
		
		$expCsvFile = 'Riepilogo_contatti.csv';
		if ( isset( $this->request['expDati'] ) )
		{
			$arrExp = array();
			$arrExp[] = "Nome|Cognome|campagna|Data|Durata|Note";
			while ( $arr = $rs->FetchRow() ) 
			{
				$tmpData = $this->sqlFunc->_type_format("db2date", $arr["ore_data"]);
				$arrExp[] = $arr["ana_nome"]."|".$arr["ana_cognome"]."|".$arr["cam_campagna"]."|$tmpData|".$arr["ore_durata"]."|".$arr["ore_note"].";";		
			}	
			$this->exportCsv( $arrExp, $expCsvFile );

		}
		else
		{
			$this->request["arrContatti"] = array();
			
			while ( $arr = $rs->FetchRow() ) 
			{
				$lotto = $arr["lotto"];
				
				foreach( $arr As $key => $Val)
				{
					if ($key == "lotto" || $key == "data") continue;
					$this->request["arrContatti"][$lotto][$key]= $Val;
// 					print "$key <br/>";
				}
				
// 				return;
			}

				print_r ($this->request["arrContatti"]);
// 				$arr => $key;
// 				$this->request["esito"] =  
// 				$this->request["id"][] = $arr["ore_id"];
// 				$this->request["nome"][] = $arr["ana_nome"];
// 				$this->request["cognome"][] = $arr["ana_cognome"];
// 				$this->request["campagna"][] = $arr["cam_campagna"];
// 				$this->request["data"][] = $this->sqlFunc->_type_format("db2date", $arr["ore_data"]);
// 				$this->request["durata"][] = $arr["ore_durata"];
// 				$this->request["note"][] = $arr["ore_note"];
				
				
				//$this->request["note"][] = $this->analyzeArray->pushCol( "note", -1, 'javascript' );
				//$this->request["noteTR"][] = $this->analyzeArray->pushCol( "note", -1, 'truncate', 0 ,40 );
			

// 			print_r ($this->request);
		}
		return true;
	}
}
		
?>